use serde::{Deserialize, Serialize};

use aspect_codec::prelude::*;

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct HomeserverCreds {
    pub homeserver: String,
    pub username: String,
    pub password: String,
}

impl HomeserverCreds {
    pub fn new(homeserver: String, username: String, password: String) -> Self {
        Self {
            homeserver,
            username,
            password,
        }
    }
}

aspect_codec::inst_struct_codec! {
    HomeserverCreds {
        homeserver: String,
        username: String,
        password: String,
    }
}
